<template>
    <div class="flexbox flexcenter flexbetween" :class="{'create_head':dataForm.step==2 || dataForm.step==4,'plan_header':dataForm.step==3,'com_box':dataForm.step==3}">
        <img src="../../../assets/img/step_icon2.svg" alt="" v-if="dataForm.step==2">
        <img src="../../../assets/img/step_icon3.svg" alt="" v-else-if="dataForm.step==3">
        <img src="../../../assets/img/step_icon4.svg" alt="" v-else-if="dataForm.step==4">
        <div class="create_cal flexbox flexcenter" v-if="dataForm.createform.type==1">
            <div class="cal_item">
                <div class="cal_num">{{dataForm.tableData.length}}</div>
                <div class="cal_text">抖音号</div>
            </div>
            <img src="../../../assets/img/sybol_x.svg" alt="" class="sybol_img">
            <div class="cal_item">
                <div class="cal_num">{{maxLength}}</div>
                <div class="cal_text">智能匹配</div>
            </div>
            <template v-if="dataForm.market=='VIDEO_PROM_GOODS' || dataForm.createform.creative_way=='VIDEO' || dataForm.createform.creative_way.includes('VIDEO')">
                <img src="../../../assets/img/sybol_x.svg" alt="" class="sybol_img">
                <div class="cal_item">
                    <div class="cal_num">{{dataForm.createform.creatinfo_list.length}}</div>
                    <div class="cal_text">创意组</div>
                </div>
            </template>
            <img src="../../../assets/img/sybol_e.svg" alt="" class="sybol_img">
            <div class="cal_item">
                <div class="cal_num" v-if="dataForm.market=='VIDEO_PROM_GOODS' || dataForm.createform.creative_way=='VIDEO' || dataForm.createform.creative_way.includes('VIDEO')">{{dataForm.tableData.length*maxLength*dataForm.createform.creatinfo_list.length}}</div>
                <div class="cal_num" v-else>{{dataForm.tableData.length*maxLength}}</div>
                <div class="cal_text">计划总数</div>
            </div>
        </div>
        <div class="create_cal flexbox flexcenter" v-else>
            <div class="cal_item">
                <div class="cal_num">{{dataForm.tableData.length}}</div>
                <div class="cal_text">抖音号</div>
            </div>
            <img src="../../../assets/img/sybol_x.svg" alt="" class="sybol_img">
            <div class="cal_item">
                <div class="cal_num">{{dataForm.createform.budget_list.length}}</div>
                <div class="cal_text">预算</div>
            </div>
            <img src="../../../assets/img/sybol_x.svg" alt="" class="sybol_img">
            <div class="cal_item">
                <div class="cal_num">{{dataForm.createform.audience_list.length}}</div>
                <div class="cal_text">定向</div>
            </div>
            <template v-if="dataForm.extension=='STANDARD'">
                <img src="../../../assets/img/sybol_x.svg" alt="" class="sybol_img">
                <div class="cal_item">
                    <div class="cal_num">{{dataForm.createform.industry_list.length}}</div>
                    <div class="cal_text">创意分类</div>
                </div>
            </template>
            <template v-if="dataForm.market=='VIDEO_PROM_GOODS' || dataForm.createform.creative_way=='VIDEO' || dataForm.createform.creative_way.includes('VIDEO')">
                <img src="../../../assets/img/sybol_x.svg" alt="" class="sybol_img">
                <div class="cal_item">
                    <div class="cal_num">{{dataForm.createform.creatinfo_list.length}}</div>
                    <div class="cal_text">创意组</div>
                </div>
            </template>
            <template v-if="dataForm.createform.creative_material_mode=='PROGRAMMATIC_CREATIVE'">
                <img src="../../../assets/img/sybol_x.svg" alt="" class="sybol_img">
                <div class="cal_item">
                    <div class="cal_num">{{dataForm.createform.creattitle_list.length}}</div>
                    <div class="cal_text">标题组</div>
                </div>
            </template>
            <img src="../../../assets/img/sybol_e.svg" alt="" class="sybol_img">
            <div class="cal_item">
                <div class="cal_num">{{allLength}}</div>
                <div class="cal_text">计划总数</div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props:["dataForm"],
    name: "",
    data() {
        return {};
    },
    created() {},
    methods: {},
    computed: {
        // 智能计划取最大值
        maxLength() {
            let arr = [];
            if (this.dataForm.createform.type == 1) {
                if (
                    this.dataForm.market == "VIDEO_PROM_GOODS" ||
                    this.dataForm.createform.creative_way == "VIDEO"
                ) {
                    if (
                        this.dataForm.createform.creative_material_mode ==
                        "CUSTOM_CREATIVE"
                    ) {
                        arr = [
                            this.dataForm.createform.budget_list.length,
                            this.dataForm.createform.audience_list.length,
                            this.dataForm.createform.industry_list.length,
                        ];
                    } else {
                        arr = [
                            this.dataForm.createform.budget_list.length,
                            this.dataForm.createform.audience_list.length,
                            this.dataForm.createform.industry_list.length,
                            this.dataForm.createform.creattitle_list.length,
                        ];
                    }
                } else {
                    if (
                        this.dataForm.createform.creative_material_mode ==
                        "CUSTOM_CREATIVE"
                    ) {
                        arr = [
                            this.dataForm.createform.budget_list.length,
                            this.dataForm.createform.audience_list.length,
                            this.dataForm.createform.industry_list.length,
                        ];
                    } else {
                        arr = [
                            this.dataForm.createform.budget_list.length,
                            this.dataForm.createform.audience_list.length,
                            this.dataForm.createform.industry_list.length,
                            this.dataForm.createform.creattitle_list.length,
                        ];
                    }
                }
            }
            return Math.max(...arr);
        },

        // 总数
        allLength() {
            let arr = 0;
            let tb_num = this.dataForm.tableData.length
            let bd_num = this.dataForm.createform.budget_list.length
            let ad_num = this.dataForm.createform.audience_list.length
            let in_num = this.dataForm.createform.industry_list.length
            let cy_num = this.dataForm.createform.creatinfo_list.length
            let tt_num = this.dataForm.createform.creattitle_list.length
            if(this.dataForm.market=='VIDEO_PROM_GOODS' || this.dataForm.createform.creative_way=='VIDEO'){
                if(this.dataForm.createform.creative_material_mode=='CUSTOM_CREATIVE'){
                    arr = tb_num*bd_num*ad_num*in_num*cy_num
                }else if(this.dataForm.createform.creative_material_mode=='PROGRAMMATIC_CREATIVE'){
                    arr = tb_num*bd_num*ad_num*in_num*cy_num*tt_num
                }
            }else{
                if(this.dataForm.createform.creative_material_mode=='CUSTOM_CREATIVE'){
                    arr = tb_num*bd_num*ad_num*in_num*cy_num
                }else if(this.dataForm.createform.creative_material_mode=='PROGRAMMATIC_CREATIVE'){
                    if(this.dataForm.createform.creative_way.includes('VIDEO')){
                        arr = tb_num*bd_num*ad_num*in_num*cy_num*tt_num
                    }else{
                        arr = tb_num*bd_num*ad_num*in_num*tt_num
                    }
                    
                }
            }
            return arr
        },
    },
    components: {},
};
</script>


<style scoped>
</style>

